package com.lz.ccjdemo.greendao.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.lz.ccjdemo.greendao.data.DishData;
import com.lz.ccjdemo.greendao.data.OperationProcessData;
import com.lz.ccjdemo.greendao.data.WarehouseData;

import com.lz.ccjdemo.greendao.dao.DishDataDao;
import com.lz.ccjdemo.greendao.dao.OperationProcessDataDao;
import com.lz.ccjdemo.greendao.dao.WarehouseDataDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig dishDataDaoConfig;
    private final DaoConfig operationProcessDataDaoConfig;
    private final DaoConfig warehouseDataDaoConfig;

    private final DishDataDao dishDataDao;
    private final OperationProcessDataDao operationProcessDataDao;
    private final WarehouseDataDao warehouseDataDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        dishDataDaoConfig = daoConfigMap.get(DishDataDao.class).clone();
        dishDataDaoConfig.initIdentityScope(type);

        operationProcessDataDaoConfig = daoConfigMap.get(OperationProcessDataDao.class).clone();
        operationProcessDataDaoConfig.initIdentityScope(type);

        warehouseDataDaoConfig = daoConfigMap.get(WarehouseDataDao.class).clone();
        warehouseDataDaoConfig.initIdentityScope(type);

        dishDataDao = new DishDataDao(dishDataDaoConfig, this);
        operationProcessDataDao = new OperationProcessDataDao(operationProcessDataDaoConfig, this);
        warehouseDataDao = new WarehouseDataDao(warehouseDataDaoConfig, this);

        registerDao(DishData.class, dishDataDao);
        registerDao(OperationProcessData.class, operationProcessDataDao);
        registerDao(WarehouseData.class, warehouseDataDao);
    }
    
    public void clear() {
        dishDataDaoConfig.clearIdentityScope();
        operationProcessDataDaoConfig.clearIdentityScope();
        warehouseDataDaoConfig.clearIdentityScope();
    }

    public DishDataDao getDishDataDao() {
        return dishDataDao;
    }

    public OperationProcessDataDao getOperationProcessDataDao() {
        return operationProcessDataDao;
    }

    public WarehouseDataDao getWarehouseDataDao() {
        return warehouseDataDao;
    }

}
